//
//  MPEpisode.h
//  MissPaparazzi
//
//  Created by Alexey Aleshkov on 09.09.12.
//  Copyright (c) 2012 DzeTech. All rights reserved.
//


#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>


typedef enum MPEpisodeDownloadState
{
	MPEpisodeDownloadNone,
	MPEpisodeDownloadDownloading,
	MPEpisodeDownloadProcessing,
	MPEpisodeDownloadDownloaded
} MPEpisodeDownloadState;


@interface MPEpisode : NSManagedObject
{
	UIImage *_thumbnailImage;
	long long _readBytes;
	long long _totalBytes;
	MPEpisodeDownloadState _downloadState;
}

@property (nonatomic, retain) NSString *productID;
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *fullText;
@property (nonatomic, retain) NSNumber *free;
@property (nonatomic, retain) NSString *size;
@property (nonatomic, retain) NSDate *date;
@property (nonatomic, retain) NSNumber *imageDownloaded;
@property (nonatomic, readonly) UIImage *thumbnailImage;

@property (nonatomic, retain) NSNumber *price;
@property (nonatomic, retain) NSNumber *wasPurchased;
@property (nonatomic, retain) NSNumber *downloaded;

@property (nonatomic, assign) MPEpisodeDownloadState downloadState;
@property (nonatomic, assign) long long totalBytes;
@property (nonatomic, assign) long long readBytes;

- (NSString *)coreDataDescription;
+ (NSString *)coreDataDescriptionForArray:(NSArray *)array;

@end



@interface ImageToDataTransformer : NSValueTransformer

@end
